package itman.elm.controller;

import itman.elm.po.Food;
import itman.elm.service.impl.FoodServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.List;

public class FoodController {

    // http://localhost:8080/elm/FoodController/listFoodByBusinessId?businessId=1
    public Object listFoodByBusinessId(HttpServletRequest request, HttpServletResponse response) throws Exception{
        Integer businessId = Integer.valueOf(request.getParameter("businessId"));
        FoodServiceImpl service = new FoodServiceImpl();
        List<Food> list = service.listFoodByBusinessId(businessId);
        return list;
    }

}
